package com.temp.dto;

import com.temp.annotation.EmailUnique;
import com.temp.annotation.LoginNameUnique;
import com.temp.annotation.Xss;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class UserForgetPWDTO {

    @NotBlank(message = "apiMsg.emailNotNull")
    @Email(message = "apiMsg.emailNotTrue")
    @Xss(message = "apiMsg.emailXss")
    private String email;

    @NotBlank(message = "apiMsg.passwordNotNull")
    @Length(min = 6, max = 20, message = "apiMsg.passwordRange,6~20")
    @Xss(message = "apiMsg.passwordXss")
    private String newPassword;

    @NotBlank(message = "apiMsg.againPasswordNotNull")
    @Length(min = 6, max = 20, message = "apiMsg.againPasswordRange,6~20")
    private String againPassword;

    @NotBlank(message = "apiMsg.userNameNotNull")
    @Length(min = 4, max = 20, message = "apiMsg.userNameRange,4~20")
    @Xss(message = "apiMsg.usernameXss")
    private String username;

    @NotBlank(message = "apiMsg.signNotNull")
    @Pattern(regexp = "^[A-Za-z0-9]{32}$|", message = "apiMsg.validSign,32")
    private String signature;
}
